﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestManageMap.aspx.cs" Inherits="System.Web.Map.TestManageMap" %>

<%@ Import Namespace="Newtonsoft.Json" %>
<%@ Import Namespace="System.Web.Map" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
       <style>
        html, body, iframe {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            border: none;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <%
        var data = new ManageMapReqModel()
        {
            ReturnUrl= "save",
            MapData = new List<ManageMapItemModel>()
            {
                new ManageMapItemModel()
                {
                    Id = "1",
                    InfoWindowMsg = "罗湖区翠竹路富安娜前人行道",
                    Address = "罗湖区翠竹路富安娜前人行道",
                    City = "深圳",
                    MapLabel = "1号店",
                    MapLocation = new PointModel()
                    {
                    lat = 22.56313,
                    lng = 114.1373
                    }
                },
                 new ManageMapItemModel()
                {
                    Id = "2",
                    InfoWindowMsg = "布吉荣超花园外国语学校旁",
                    Address = "布吉荣超花园外国语学校旁",
                    City = "深圳",
                    MapLabel = "2号店",
                    MapLocation = new PointModel()
                    {
                    lat = 22.59888,
                    lng = 114.1258
                    }
                },
                new ManageMapItemModel()
                {
                    Id = "3",
                    InfoWindowMsg = "天安门",
                  Address = "天安门",
                    MapLabel = "3号店",
                    City = "北京",
                },
                new ManageMapItemModel()
                {
                    Id = "4",
                    InfoWindowMsg = "世博园",
                  Address = "世博园",
                    MapLabel = "4号店",
                    City = "上海",
                },
            }
        };
        reqParamData.Value = JsonConvert.SerializeObject(data);
    %>
    <iframe frameborder="0" name="frame" id="frame"></iframe>
    <form id="form1" runat="server" action="http://mapdev.lizhanglong.com/Map.aspx" target="frame">
        <asp:HiddenField runat="server" ID="reqParamData" />
        <input type="hidden" value="manageMap" name="method" />
    </form>
    <script>
        if (!/^[\d\.\:]+$/.test(location.host)) {
            document.domain = location.host.match(/(\w+\.\w+)(:|$)/)[1];
        }

        function save(data) {
            alert(JSON.stringify(arguments));
        }
        document.forms[0].submit();
    </script>
</body>
</html>
